package freshmanspecial.mredrock.com.welcomefreshman.Fragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;

import java.util.ArrayList;

import freshmanspecial.mredrock.com.welcomefreshman.Adapter.StrategyRecyclerAdapter;
import freshmanspecial.mredrock.com.welcomefreshman.Base.BaseFragment;
import freshmanspecial.mredrock.com.welcomefreshman.Model.StrategyModel;
import freshmanspecial.mredrock.com.welcomefreshman.R;

/**
 * Created by HP on 2017/8/11.
 */

public class Stragegy_zhoubian_fragment extends BaseFragment{
    private RecyclerView mRecyclerView;
    private StrategyRecyclerAdapter adapter;
    private ArrayList<String> titleList,contentList,dizhiList;
    private int Shenghuo=6,Meishi=7,MeiJing=8,type;
    public  Stragegy_zhoubian_fragment(int type){
        this.type = type;
    }

    @Override
    protected void addDefaultData() {
        initView();
    }

    protected void addData() {

    }

    @Override
    protected void initView() {
        titleList = new ArrayList<>();
        contentList = new ArrayList<>();
        dizhiList = new ArrayList<>();
        StrategyModel strategyModel = new StrategyModel();
        mRecyclerView = $(R.id.recyclerview);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        titleList.clear();
        contentList.clear();
        dizhiList.clear();
        if(type == MeiJing)
        {
            setList(type);
            strategyModel.getMeijing(new StrategyModel.OnGetData() {
                @Override
                public void onFinish(Object dataBean) {
                    mRecyclerView.setAdapter(adapter = new StrategyRecyclerAdapter(getContext(),dataBean,8));
                }
            });
        }
        if(type==Meishi){
            setList(type);
            strategyModel.getMeishi(new StrategyModel.OnGetData() {
                @Override
                public void onFinish(Object dataBean) {
                    mRecyclerView.setAdapter(adapter = new StrategyRecyclerAdapter(getContext(),dataBean,7));

                }
            });
        }
        if(type==Shenghuo)
        {
            setList(type);
            strategyModel.getLife(new StrategyModel.OnGetData() {
                @Override
                public void onFinish(Object dataBean) {
                    mRecyclerView.setAdapter(adapter = new StrategyRecyclerAdapter(getContext(),dataBean,6));

                }
            });
        }


    }

    private void setList(int type) {
        if(type==Meishi)
        {
            titleList.add("重庆鸡公煲");
            contentList.add("好吃不辣，量足管饱");
            dizhiList.add("老校门对面堕落街");
            titleList.add("新疆沙湾大盘鸡");
            contentList.add("独具疆域特色");
            dizhiList.add("老校门对面堕落街");
            titleList.add("福宇记黄焖鸡");
            contentList.add("老校门对面堕落街");
            dizhiList.add("香味浓郁");
            titleList.add("撒拉尔牛肉面");
            contentList.add("独具清真特色");
            dizhiList.add("老校门对面堕落街");
            titleList.add("渝香铁板烧");
            contentList.add("味道纯正，香气十足");
            dizhiList.add("老校门对面堕落街");
            titleList.add("刘氏鸡公煲");
            contentList.add("浓香滑嫩，入味彻底");
            dizhiList.add("老校门对面堕落街");
            titleList.add("阿里郎");
            contentList.add("老校门对面堕落街");
            dizhiList.add("独具台式风味");
            titleList.add("陈记干锅");
            contentList.add("量大分足，赏心悦目");
            dizhiList.add("老校门对面堕落街");
            titleList.add("李海粥王");
            contentList.add("营养美味");
            dizhiList.add("老校门对面堕落街");
            titleList.add("旮旯酸辣粉、羊肉粉");
            contentList.add("老校门对面堕落街");
            dizhiList.add("回味悠长，麻辣鲜香");
            titleList.add("三番料理");
            contentList.add("唇齿留香，色味俱佳");
            dizhiList.add("老校门对面堕落街");
            titleList.add("好又来");
            contentList.add("好吃又贵");
            dizhiList.add("老校门对面堕落街");
            titleList.add("咖喱至尊");
            contentList.add("色香味美，物美价廉");
            dizhiList.add("老校门对面堕落街");
        }
        if(type == Shenghuo){
            titleList.add("重庆农村商业银行");
            contentList.add("方便取存款，办理业务。");
            dizhiList.add("重庆邮电大学旁，老校门出门，过马路，右转。");
            titleList.add("中国邮政");
            contentList.add("可以办理相关业务，取存款等。");
            dizhiList.add("重庆邮电大学旁，老校门出门，右转。新校门出门，左转。");
            titleList.add("中国工商银行自助服务点");
            contentList.add("距离学校较近，比较方便");
            dizhiList.add("重庆邮电大学旁，新校门出门，左转直走，老校门出门，右转直走。");
            titleList.add("渝芳百货商场");
            contentList.add("物品较为丰富");
            dizhiList.add("重庆邮电大学旁，新校门出门，左转直走。老校门出门，右转直走。");
            titleList.add("永辉超市");
            contentList.add("物品齐全，价钱相对便宜");
            dizhiList.add("重庆邮电大学旁，新校门出门过马路，右转直走");
            titleList.add("新世纪超市");
            contentList.add("各类物品较为齐全");
            dizhiList.add("重庆邮电大学旁，新校门出门右转，过一条马路直走");
            titleList.add("联佰大药房");
            contentList.add("药品相对齐全");
            dizhiList.add("重庆邮电大学旁，新校门出门，过马路，右转直走。");
            titleList.add("多乐迪KTV");
            contentList.add("环境较好，是个唱歌的好地方");
            dizhiList.add("重庆邮电大学旁，新校门出门右转，中国农业银行楼下");
            titleList.add("ZAKKA生活小铺");
            contentList.add("文具等用品齐全");
            dizhiList.add("重庆邮电大学旁，新校门出门，左转直走，老校门出门，右转直走");
        }
        if (type == MeiJing)
        {
            titleList.add("大金鹰");
            contentList.add("数十里景物尽收眼底");
            dizhiList.add("重庆市南岸区南山路25路大金鹰园内");
            titleList.add("黄葛古道");
            contentList.add("G65包茂高速附近");
            dizhiList.add("重庆的“丝绸之道”");
            titleList.add("重庆抗战遗址博物馆");
            contentList.add("重庆市南岸区南山植物园路1号");
            dizhiList.add("历史、自然气息浓厚");
            titleList.add("老君洞");
            contentList.add("重庆主城区最大最主要的宫观");
            dizhiList.add("重庆市南岸区龙黄公路");
            titleList.add("南滨公园");
            contentList.add("开放带状公园");
            dizhiList.add("重庆市南岸区南滨路80号");
            titleList.add("南之山书店");
            contentList.add("一间看得见风景的书店");
            dizhiList.add("南山公园北路128号");
            titleList.add("涂山湖");
            contentList.add("四季景色尽揽眼底");
            dizhiList.add("重庆市南岸区崇文路16号");
            titleList.add("一棵树观景台");
            contentList.add("感受山水之城的起伏面貌。");
            dizhiList.add("重庆市南岸区风景区南山一棵树内");
        }
    }

    @Override
    protected int getResourceId() {
        return R.layout.special_2017_strategy_fragment;
    }
}
